using System;
using System.Collections;
using System.Collections.Generic;
using MyProject.Persona;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;

public class PersonaDiary : MonoBehaviour
{

    [Header("关键人格日记")] [SerializeField] private bool importantDiary;
    [SerializeField] private Personas persona;

    // private void Awake()
    // {
    //     Debug.Log(persona);
    // }


    [SerializeField] private string diaryText;
    
    private void OnTriggerStay2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            if (importantDiary)
            {
                other.GetComponent<PlayerController>().personas.Add(persona);
            }

            TabTextManger.Instance.tabTextField.text = diaryText;
            //TODO : 增加文本
            Destroy(gameObject);
        }
    }

}
